package com.ruoyi.mstore.service;

import com.ruoyi.mstore.domain.RescueTask;
import com.ruoyi.mstore.mapper.RescueTaskMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RescueTaskService {
    @Autowired
    private RescueTaskMapper rescueTaskMapper;

//    根据主键查询
    public List<RescueTask> getByRescueTask(Long rescueId){
        return rescueTaskMapper.selectByPrimaryKey(rescueId);
    }

    public void acceptRescueTask(String messageId, String merchantId) {
        rescueTaskMapper.updateRescueStatus(

                messageId,
                merchantId,
                2
        );
        System.out.println("商家"+merchantId+"已接受救援任务"+messageId);
    }
}
